home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000…tember: Reference Library / Dev.CD Sep 00 RL Disk 1.toast / mac / Technical Documentation / Develop / develop Issue 29 / develop Issue 29 code / InlineInputSample / InlineInputSample.r < prev    next >
Encoding:
Text File  |  1997-01-07  |  6.6 KB  |  355 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        InlineInputSample.r
  3.  
  4.     Contains:    Resource definitions for InlineInputSample
  5.  
  6.     Copyright:    © 1989-1994 Apple Computer, Inc. All rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #if qInline
  12. #define qAppleEvents 1
  13. #else
  14. #define qAppleEvents 0
  15. #endif
  16.  
  17.  
  18. #define SystemSevenOrLater 1
  19.  
  20. #include "SysTypes.r"
  21. #include "Types.r"
  22. #include "CodeFragmentTypes.r"
  23.  
  24. #include "InlineInputSample.h"
  25.  
  26.  
  27. // application signature and name
  28.  
  29. #define kSignature 'issa'
  30. #if qAppleEvents
  31. #if qInline
  32. #define kApplicationName "InlineInputSample"
  33. #define kApplicationBlurb "Styled TextEdit Application with Inline Input"
  34. #else // qInline
  35. #define kApplicationName "AppleEventsSample"
  36. #define kApplicationBlurb "Styled TextEdit Application with Apple Events"
  37. #endif // qInline
  38. #else // qAppleEvents
  39. #define kApplicationName "SimpleSample"
  40. #define kApplicationBlurb "Styled TextEdit Application"
  41. #endif // qAppleEvents
  42.  
  43. // constant for disabling all items in a menu
  44.  
  45. #define allDisabled 0
  46.  
  47.  
  48. resource 'vers' (1) {
  49.     0x01, 0x01, release, 0x00, verUS,
  50.     "1.0.1",
  51.     "1.0.1, (c) 1989-1994 Apple Computer, Inc."
  52. };
  53.  
  54.  
  55. // we use an MBAR resource to conveniently load all the menus
  56.  
  57. resource 'MBAR' (rMenuBar, preload) {
  58.     { mApple, mFile, mEdit, mFont, mFontSize, mStyle };
  59. };
  60.  
  61.  
  62. resource 'MENU' (mApple, preload) {
  63.     mApple, textMenuProc,
  64.     allEnabled,
  65.     enabled, apple,
  66.     {
  67.         "About " kApplicationName "...",
  68.             noicon, nokey, nomark, plain;
  69.         "-",
  70.             noicon, nokey, nomark, plain
  71.     }
  72. };
  73.  
  74. resource 'MENU' (mFile, preload) {
  75.     mFile, textMenuProc,
  76.     allDisabled,
  77.     enabled, "File",
  78.     {
  79.         "New",
  80.             noicon, "N", nomark, plain;
  81.         "Open...",
  82.             noicon, "O", nomark, plain;
  83.         "-",
  84.             noicon, nokey, nomark, plain;
  85.         "Close",
  86.             noicon, "W", nomark, plain;
  87.         "Save",
  88.             noicon, "S", nomark, plain;
  89.         "-",
  90.             noicon, nokey, nomark, plain;
  91.         "Page Setup...",
  92.             noicon, nokey, nomark, plain;
  93.         "Print...",
  94.             noicon, nokey, nomark, plain;
  95.         "-",
  96.             noicon, nokey, nomark, plain;
  97.         "Quit",
  98.             noicon, "Q", nomark, plain
  99.     }
  100. };
  101.  
  102. resource 'MENU' (mEdit, preload) {
  103.     mEdit, textMenuProc,
  104.     allDisabled,
  105.     enabled, "Edit",
  106.      {
  107.         "Undo",
  108.             noicon, "Z", nomark, plain;
  109.         "-",
  110.             noicon, nokey, nomark, plain;
  111.         "Cut",
  112.             noicon, "X", nomark, plain;
  113.         "Copy",
  114.             noicon, "C", nomark, plain;
  115.         "Paste",
  116.             noicon, "V", nomark, plain;
  117.         "Clear",
  118.             noicon, nokey, nomark, plain;
  119.         "-",
  120.             noicon, nokey, nomark, plain;
  121.         "Select All",
  122.             noicon, "A", nomark, plain
  123.     }
  124. };
  125.  
  126. resource 'MENU' (mFont, preload) {
  127.     mFont, textMenuProc,
  128.     allEnabled,
  129.     enabled, "Font",
  130.      {
  131.      }
  132. };
  133.  
  134. resource 'MENU' (mFontSize, preload) {
  135.     mFontSize, textMenuProc,
  136.     allEnabled,
  137.     enabled, "Size",
  138.      {
  139.          "9 Point", noIcon, noKey, noMark, plain,
  140.         "10 Point", noIcon, noKey, noMark, plain,
  141.         "12 Point", noIcon, noKey, noMark, plain,
  142.         "14 Point", noIcon, noKey, noMark, plain,
  143.         "18 Point", noIcon, noKey, noMark, plain,
  144.         "24 Point", noIcon, noKey, noMark, plain
  145.      }
  146. };
  147.  
  148. resource 'MENU' (mStyle, preload) {
  149.     mStyle, textMenuProc,
  150.     allEnabled,
  151.     enabled, "Style",
  152.      {
  153.         "Plain",
  154.             noicon, "P", nomark, plain;
  155.         "-",
  156.             noicon, nokey, nomark, plain;
  157.         "Bold",
  158.             noicon, "B", nomark, bold;
  159.         "Italic",
  160.             noicon, "I", nomark, italic;
  161.         "Underline",
  162.             noicon, "U", nomark, underline;
  163.         "Outline",
  164.             noicon, nokey, nomark, outline;
  165.         "Shadow",
  166.             noicon, nokey, nomark, shadow
  167.     }
  168. };
  169.  
  170.  
  171. /* this ALRT and DITL are used as an About screen */
  172.  
  173. resource 'ALRT' (rAboutAlert, purgeable) {
  174.     {40, 20, 210, 340},
  175.     rAboutAlert,
  176.     {    OK, visible, silent,
  177.         OK, visible, silent,
  178.         OK, visible, silent,
  179.         OK, visible, silent
  180.     },
  181.     alertPositionMainScreen
  182. };
  183.  
  184. resource 'DITL' (rAboutAlert, purgeable) {
  185.     {    /* array DITLarray: 5 elements */
  186.         /* [1] */
  187.         {140, 230, 160, 310},
  188.         Button {
  189.             enabled,
  190.             "OK"
  191.         },
  192.         /* [2] */
  193.         {10, 10, 26, 329},
  194.         StaticText {
  195.             disabled,
  196.             kApplicationBlurb
  197.         },
  198.         /* [3] */
  199.         {30, 10, 62, 336},
  200.         StaticText {
  201.             disabled,
  202.             "(c) 1989-1994 Apple Computer, Inc. \n"
  203.             "All rights reserved."
  204.         },
  205.         /* [4] */
  206.         {70, 10, 86, 139},
  207.         StaticText {
  208.             disabled,
  209.             "Brought to you by:"
  210.         },
  211.         /* [5] */
  212.         {90, 30, 122, 299},
  213.         StaticText {
  214.             disabled,
  215.             "Developer Support Center &\n"
  216.             "International Software Support"
  217.         }
  218.     }
  219. };
  220.  
  221.  
  222. /* this ALRT and DITL are used as an error screen */
  223.  
  224. resource 'ALRT' (rUserAlert, purgeable) {
  225.     {40, 20, 150, 260},
  226.     rUserAlert,
  227.     { /* array: 4 elements */
  228.         /* [1] */
  229.         OK, visible, silent,
  230.         /* [2] */
  231.         OK, visible, silent,
  232.         /* [3] */
  233.         OK, visible, silent,
  234.         /* [4] */
  235.         OK, visible, silent
  236.     },
  237.     alertPositionMainScreen
  238. };
  239.  
  240.  
  241. resource 'DITL' (rUserAlert, purgeable) {
  242.     { /* array DITLarray: 3 elements */
  243.         /* [1] */
  244.         {80, 150, 100, 230},
  245.         Button {
  246.             enabled,
  247.             "OK"
  248.         },
  249.         /* [2] */
  250.         {10, 60, 60, 230},
  251.         StaticText {
  252.             disabled,
  253.             "Error. ^0"
  254.         },
  255.         /* [3] */
  256.         {8, 8, 40, 40},
  257.         Icon {
  258.             disabled,
  259.             2
  260.         }
  261.     }
  262. };
  263.  
  264.  
  265. resource 'WIND' (rDocWindow, preload, purgeable) {
  266.     {64, 60, 314, 460},
  267.     zoomDocProc, invisible, goAway, 0x0, "Untitled",
  268.     staggerParentWindowScreen
  269. };
  270.  
  271.  
  272. resource 'CNTL' (rVScroll, preload, purgeable) {
  273.     {-1, 385, 236, 401},
  274.     0, visible, 0, 0, scrollBarProc, 0, ""
  275. };
  276.  
  277.  
  278. resource 'CNTL' (rHScroll, preload, purgeable) {
  279.     {235, -1, 251, 386},
  280.     0, visible, 0, 0, scrollBarProc, 0, ""
  281. };
  282.  
  283. resource 'STR#' (rErrorStrings, purgeable) {
  284.     {
  285.     kApplicationName " needs at least a Macintosh 512Ke to run.";
  286.     kApplicationName " needs at least system software 6.0 to run.";
  287.     "Application memory size is too small.";
  288.     "Not enough memory to run " kApplicationName ".";
  289.     "Not enough memory to do Cut.";
  290.     "Cannot do Cut.";
  291.     "Cannot do Copy.";
  292.     "Cannot exceed 32,000 characters with Paste.";
  293.     "Not enough memory to do Paste.";
  294.     "Cannot create window.";
  295.     "Cannot exceed 32,000 characters.";
  296.     "Cannot do Paste."
  297.     }
  298. };
  299.  
  300. type kSignature as 'STR ';
  301.  
  302.  
  303. resource kSignature (0) {
  304.     kApplicationName ": "
  305.     kApplicationBlurb ". "
  306.     "© 1989-1994 Apple Computer, Inc. All rights reserved."
  307. };
  308.  
  309.  
  310. resource 'BNDL' (128) {
  311.     kSignature,
  312.     0,
  313.     {
  314.         'ICN#',
  315.         {
  316.             0, 128
  317.         },
  318.         'FREF',
  319.         {
  320.             0, 128
  321.         }
  322.     }
  323. };
  324.  
  325.  
  326. resource 'FREF' (128) {
  327.     'APPL',
  328.     0,
  329.     ""
  330. };
  331.  
  332.  
  333. resource 'ICN#' (128, purgeable) {
  334.     {    /* array: 2 elements */
  335.         /* [1] */
  336.         $"0001 0000 0002 8000 0004 4000 0008 2000"
  337.         $"0010 101C 0021 0822 0042 0441 0084 42A1"
  338.         $"0108 8151 0211 12AA 0422 2554 0800 4AA8"
  339.         $"1088 1550 2111 2AA8 4202 5544 8444 AA82"
  340.         $"4088 9501 2110 CA02 1020 E404 0840 F808"
  341.         $"0400 0010 0200 0020 0100 0040 0080 0080"
  342.         $"0040 0100 0020 0200 0010 0400 0008 0800"
  343.         $"0004 1000 0002 2000 0001 4000 0000 80",
  344.         /* [2] */
  345.         $"0001 0000 0003 8000 0007 C000 000F E000"
  346.         $"001F F01C 003F F83E 007F FC7F 00FF FEFF"
  347.         $"01FF FFFF 03FF FFFE 07FF FFFC 0FFF FFF8"
  348.         $"1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE"
  349.         $"7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFF8"
  350.         $"07FF FFF0 03FF FFE0 01FF FFC0 00FF FF80"
  351.         $"007F FF00 003F FE00 001F FC00 000F F800"
  352.         $"0007 F000 0003 E000 0001 C000 0000 80"
  353.     }
  354. };
  355.